<?php
	echo $this->Html->script('jquery');
	$this->Paginator->options(array(
			'update' => '#content',
			'evalScripts' => true,
			'before' => $this->Js->get('#busy-indicator')->effect('fadeIn', array('buffer' => false)),
			'complete' => $this->Js->get('#busy-indicator')->effect('fadeOut', array('buffer' => false)),
	));
?>

<div class="players index">
	<h2><?php echo __('Players');?></h2>
	
	<?php
		$options = array('PLIN','First Name','Surname','Email','Any Text');
		$clear = !is_null($this->Session->read('Player.search_data'));
		$this->QuickSearch->makeQuickSearch($options, $clear);
	?>
	
	<table cellpadding="0" cellspacing="0">
	<tr>
			<th><?php echo $this->Paginator->sort('plin','PLIN');?></th>
			<th><?php echo $this->Paginator->sort('first_name');?></th>
			<th><?php echo $this->Paginator->sort('insertion');?></th>
			<th><?php echo $this->Paginator->sort('surname');?></th>
			<th><?php echo $this->Paginator->sort('gender');?></th>
			<th><?php echo $this->Paginator->sort('email');?></th>
			<th class="actions"><?php echo __('Actions');?></th>
	</tr>
<?php foreach ($players as $player): ?>
	<tr>
		<td><?php echo h($player['Player']['plin']); ?>&nbsp;</td>
		<td><?php echo h($player['Player']['first_name']); ?>&nbsp;</td>
		<td><?php echo h($player['Player']['insertion']); ?>&nbsp;</td>
		<td><?php echo h($player['Player']['surname']); ?>&nbsp;</td>
		<td><?php echo h($player['Player']['gender']); ?>&nbsp;</td>
		<td><?php echo h($player['Player']['email']); ?>&nbsp;</td>
		<td class="actions">
			<?php echo $this->Html->link(__('View'), array('action' => 'view', $player['Player']['id'])); ?>
			<?php echo $this->Html->link(__('Edit'), array('action' => 'edit', $player['Player']['id'])); ?>
			<?php echo $this->Form->postLink(__('Delete'), array('action' => 'delete', $player['Player']['id']), null, __('Are you sure you want to delete # %s?', $player['Player']['id'])); ?>
		</td>
	</tr>
<?php endforeach; ?>
	</table>
	<p>
	<?php
	$this->Paginator->options(array(
			'update' => '#content',
			'evalScripts' => true
	));
	echo $this->Paginator->counter(array(
	'format' => __('Page {:page} of {:pages}, showing {:current} records out of {:count} total, starting on record {:start}, ending on {:end}')
	));
	?>	</p>

	<div class="paging">
	<?php
		echo $this->Paginator->prev('< ' . __('previous'), array(), null, array('class' => 'prev disabled'));
		echo $this->Paginator->numbers(array('separator' => ''));
		echo $this->Paginator->next(__('next') . ' >', array(), null, array('class' => 'next disabled'));
	?>
	</div>
</div>